import request from "@/utils/request";
import { ParseData } from "@/utils/utils";

// 获取公开课/内训列表分页
export const GetOpenLessonList = (data: any) => {
  return request({
    method: "GET",
    url: `/gongkaike?${ParseData(data)}`,
  });
};
// 获取公开课/内训信息
export const GetOpenLesson = (data: any) => {
  return request({
    method: "GET",
    url: `/gongkaike/${data.id}`,
  });
};
// 获取公开课/内训详情
export const GetOpenLessonDetail = (data: any) => {
  return request({
    method: "GET",
    url: `/gongkaike/xiangqing/${data.id}`,
  });
};
// 公开课/内训上下架
export const ChangeOpenLessonStatus = (data: any) => {
  return request({
    method: "PUT",
    url: `/gongkaike/shangjia/${data.id}`,
  });
};
// 新增公开课/内训
export const AddOpenLesson = (data: any) => {
  return request({
    method: "POST",
    url: `/gongkaike`,
    data
  });
};
// 编辑公开课/内训
export const EditOpenLesson = (data: any) => {
  return request({
    method: "PUT",
    url: `/gongkaike`,
    data,
  });
};
